Skip to content

dgb(Phase-B): SSOT think() Phase-5 best-share punish walk + non-circular KAT - #378

Merged
frstrtr merged 1 commit into
masterfrom
dgb/think-p5-best-share-punish
Jun 24, 2026
Merged

dgb(Phase-B): SSOT think() Phase-5 best-share punish walk + non-circular KAT#378
frstrtr merged 1 commit into
masterfrom
dgb/think-p5-best-share-punish

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Phase-B pillar — think() Phase-5 best-share punish walk SSOT

Lifts the open-coded think() Phase-5 best-share resolution from share_tracker.hpp into a header-only SSOT src/impl/dgb/think_p5_best_share_punish.hpp. This is the last un-lifted think() region after P1/P2/P3/P4/P6.

What it pins (vs oracle p2pool data.py:2142-2166)

  • Walk back off a naughty decorated head through prev pointers.
  • On reaching the first non-naughty ancestor, dive forward to the deepest non-naughty descendant (naughty children skipped, 20-generation bound).
  • If the walk runs off the chain end (prev missing/null) while still naughty, stop on that last naughty share.
  • punish_val = the naughty count of the share best_idx finally points at (0 unless stopped ON a naughty share).

Isolation / scope

  • FENCED / additive, dgb tree only. share_tracker.hpp is per-coin (not shared core) and is NOT yet rewired — the byte-identity delegation is the follow-on, matching the P1/P3/P4 cadence.
  • Consensus-neutral: pure graph traversal, no value semantics changed.

Proof

  • dgb_think_p5_best_share_punish_test 6/6 green. Expectations are hand-derived by tracing the walk rules over hand-built fake chains (non-circular — not read back from the subject): non-naughty head, invalid-start skip, walk-back+dive-to-deepest, dive-skips-naughty-children, missing-prev punish, null-prev punish.
  • Registered in src/impl/dgb/test/CMakeLists.txt and both build.yml --target allowlist sites (ci: build test_dgb_subsidy in both Linux test jobs (fix master-red NOT_BUILT) #143 NOT_BUILT guard).

No self-merge — integrator taps after full-rollup CI green.

@frstrtr
frstrtr force-pushed the dgb/think-p5-best-share-punish branch from 99845dc to 8f2f1e8 Compare June 23, 2026 17:06
@frstrtr
frstrtr force-pushed the dgb/think-p5-best-share-punish branch 2 times, most recently from ecbaa84 to 95d5379 Compare June 23, 2026 20:47
@frstrtr
frstrtr force-pushed the dgb/think-p5-best-share-punish branch 2 times, most recently from d9a3062 to 300ef63 Compare June 23, 2026 23:27
…lar KAT

Lift the open-coded think() Phase-5 best-share resolution from
share_tracker.hpp into a header-only SSOT (think_p5_best_share_punish.hpp):
walk back off a naughty decorated head, dive to the deepest non-naughty
descendant (skipping naughty children, 20-gen bound), and report the
punishment of the share finally landed on, per p2pool data.py:2142-2166.

FENCED/additive: dgb tree only, share_tracker.hpp NOT yet rewired (the
byte-identity delegation is the follow-on). Pure graph traversal, consensus
value semantics unchanged. KAT 6/6 with hand-derived non-circular fake-chain
anchors; registered in CMake and both build.yml --target allowlist sites
(#143 NOT_BUILT guard).
@frstrtr
frstrtr force-pushed the dgb/think-p5-best-share-punish branch from 300ef63 to ca6e6de Compare June 24, 2026 00:45
@frstrtr
frstrtr merged commit 31937e8 into master Jun 24, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant